#ifndef STATS_H_INCLUDED
#define STATS_H_INCLUDED


#include "GameStates.h"


#define R 3


typedef std::array  <TTF_Font*, 2>     fArr;
typedef std::array  <SDL_Surface*, 8>  iArr;
typedef std::array  <SDL_Surface*, 19> tArr;


enum class Mark;


class GameStats
{
public:
    GameStats()
        : p1_score(0), p2_score(0), tie(0) {}

    // The compiler generated dtor, copy ctor and
    // copy assignment operator will be sufficient

    void clearStats()
    {
        p1_score  = 0;
        p2_score  = 0;
        tie       = 0;
    }

    Uint8 p1Score() const { return p1_score; }
    Uint8 p2Score() const { return p2_score; }
    Uint8 Tie()     const { return tie;      }

    void incP1Score() { ++p1_score; }
    void incP2Score() { ++p2_score; }
    void incTie()     { ++tie;      }

private:
    Uint8 p1_score;
    Uint8 p2_score;
    Uint8 tie;
};


void drawGameStats(GameStats&, const iArr&, const fArr&);
void updateGameStats(SDL_Event, Mark (&game_board)[R][R], iArr&, const fArr&, GameStats&);


#undef R


#endif // STATS_H_INCLUDED
